package com.yzkj.cpjxc.business.framework.utils;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * 项目用到的要配置的属性配置工具类
 */
public class PropUtils {

	private static PropUtils manager = null;
	
	private static Properties prop = null;
	
	public static PropUtils newInstance() {
		if (manager == null) {
			manager = new PropUtils();
			
			InputStream is = PropUtils.class.getResourceAsStream("/all.properties");
			prop = new Properties();
			try {
				prop.load(is);
				is.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return manager;
	}
	
	public static String getProperties(String key) {
		return prop.getProperty(key);
	}
}
